<template>
	<div>
		<el-form ref="form" :model="form" label-width="100px">

			<el-form-item label="审核状态" prop="status">

				<el-select v-model="form.status" placeholder="请选择审核状态" clearable :style="{width: '100%'}">
					<el-option v-for="(item, index) in stateDate" :key="index" :label="item.label" :value="item.value"
						:disabled="item.disabled"></el-option>
				</el-select>

			</el-form-item>

			<!-- <el-form-item label="审核人" prop="auditor">

				<el-select v-model="form.auditor" placeholder="请选择审核人" clearable :style="{width: '100%'}">
					<el-option v-for="(item, index) in doctorDate" :key="index" :label="item.staffName"
						:value="item.staffName" :disabled="item.disabled"></el-option>
				</el-select>
			</el-form-item> -->
			
			<!-- <el-form-item label="审核时间" prop="auditTime">
				<el-date-picker v-model="form.auditTime" format="yyyy-MM-dd HH:mm:ss" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
					:style="{width: '100%'}" placeholder="请输入时间" clearable>
				</el-date-picker>
			</el-form-item> -->

			<el-form-item label="审核意见" prop="auditOpinion">
				<el-input v-model="form.auditOpinion"></el-input>
			</el-form-item>
			<el-button type="primary" @click="save">保存</el-button>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	export default {
		name: 'approvalEdit',
		props: [
			'editid'
		],
		data() {
			return {
				form: {},
				doctorDate: [],
				stateDate: [{
					"label": "通过",
					"value": "通过"
				}, {
					"label": "不通过",
					"value": "不通过"
				}],
			}
		},
		created() {
			this.axios.get('/exitRegistration/toedit', response => {
				this.form = response.obj;
			}, {
				id: this.editid
			})

			this.axios.get('/staffManagement/findDoctor', res => {
				this.doctorDate = res.obj;
			})
		},
		methods: {
			save() {
				this.$refs['form'].validate((valid) => {
					if (valid) {
						this.axios.post('/exitRegistration/approvalSave', response => {
							console.log(response);
							// 子组件要改变父组件的值
							this.$emit('update:appShow', false);
							this.$emit('update:editid', null);
							this.$emit('getData')
						}, this.form)
					}
				})
			}
		}
	}
</script>

<style>
</style>
